<?php
namespace Factory;
/**
 * Created by PhpStorm.
 * User: cy
 * Date: 18-1-3
 * Time: 上午9:50
 * 单例模式
 */
class Mysql implements Database
{
    public static $db;
    private function __construct()
    {
    }

    public function add()
    {
        echo '增加<br>';
    }
    public function delete()
    {
        echo '删除<br>';
    }
    public function update()
    {
        echo '修改<br>';
    }
    public function select()
    {
        echo '查询<br>';
    }

    static function getInc()
    {
        if(!self::$db){
            self::$db=new Mysql();
        }
        return self::$db;
    }

}